import { request} from "../request/index";

export const getAddressInfo = (userid) =>{
  return  request({
    url: "/address/"+userid+"/",
    method:"get",
    data:{
        userid
    }
});
}

export const setAddressInfo = (id,isChecked) =>{
  return  request({
    url: "/address/"+id+"/",
    method:"put",
    data:{
        isChecked: isChecked,
    }
});
}

export const deleteAddressOne = (userid,id) =>{
  return  request({
    url: "/address/"+userid+"/",
    method:"delete",
    data:{
        address_id:id
    }
});
}


export const createAddressOne = (addressInfo) =>{
  return request({
    url: "/address/",
    method:"POST",
    data:{
       ...addressInfo
    }
});
}